# Usage: modern.tcl

if {![info exists eWorkDir]} {set eWorkDir [file dirname [info script]]}

package require DPeye

create {
	outputFile modern.ps 
	mapFile modern.map
	title "modern map"
	creator "Mario Huys (woelpad@gmail.com)"
	$MapDrawingScale 1 $MapUnitScale .6 $MapNameScale .5 $MapSupplyScale .6
	$FrameThickness 6
	images {
		chart {modern.base.ps {scan {-30 -100 800 700} {} {
				{part1 part2 part3 part4 part5 part5a SEA} part6 part7 part8 part9 part10
				part11 part12 part13 part14 part15 part16 part17 part18 part19 part20
				part21 part22 part23
			} {
				gm moveto lin lineto 
				SEA {Seawater fill} ISLAND {Landcolor fill} LAND {Landcolor fill} 
				BORDER {Nationalborder stroke} internal {Internalborder stroke} connect {CanalLine stroke}
				minx -30 miny -100 maxx 800 maxy 700
			} {}}}
		coordinates {modern.base.ps {scan {} {provinces INFO supplies TLA connections DRAW powers COUNTRY}}}
	}
	borders {
		seas {image {chart Seawater} SeaBlue CoastalBorder}
		islands {image {chart Landcolor} LandBrown CoastalBorder}
		internalBorders {image {chart Internalborder} {} Border {BorderBlack .5 {3 1} 1.5}}
		borders {image {chart Nationalborder} {} Border {BorderBlack 2}}
		canals {image {chart CanalLine} {} Border {SeaBlue 2.5 {2 3} 1.5}}
	}
	locationTypes {
		Supplies {number 0 name 0 draw 1 define -1}
		Territories {number 0 name 1 populate 3 info 1}
	}
	locations {
		supplies {image {coordinates supplies} Supplies s {Blue {} S} {
			{GIB 2 -5} {HOL -1} {HUN 1} {LON 0 -1} {MON -2 -18} {}
		}}
		coasts {image {coordinates provinces} Territories c {Red DarkGreen AF} {
			ADA ALB ALE ALG ANA {AND 6} {ANK 3 1} APU {ASW 0 2} AUV AZE 
			BAR {BEL 1} {BER 3 -1} BOR BRI {BUL 2} CAI CAU CLY {CRO 1 -2} DEN 
			DON EDI ESA EST FIN GDA GEO {GIB 4 2} GRE {HAM 1} HOL 
			ICE IRE IRK {ISR -1} IST IZM {JOR 0 -4} KAZ LAP LAT LIB 
			LIT LIV {LON 2 1} MAR {MON 1 5} MOR MUR NAP NAV NWY {ODE 2 6} 
			PIC PIE POR {PRU 0 -1} {ROM 5 -1} {ROS -1 2} {RUM 1 1} SAU {SER 6} {SEV 1} SIN 
			STP SVE SWE SYR TUN {TUS 0 -4} URA {VEN -1 1} VOL {WAL -6 -1} YOR
		}}
		lands {image {coordinates provinces} Territories l {Green DarkGreen A} {
			ALS ARM AUS BIE {BOS 0 1} CEN {CZE 9 1} FRA GOR HUN KHA 
			{KIE 0 -8} KRA LYO MAC MAD MIL MOL MOS MUN PAR POD 
			{RUH 0 -16} {SAX 0 2} SIB {SIL 0 -5} SLO SWI {WAR 2 3} WSA
		}}
		waters {image {coordinates provinces} Territories w {White White F} {
			ADR AEG ARA ARC BAL BHM BIS BRN CAS EBS EME 
			ENG {GOB 0 3} GOL HEL ION IRI LBN {LIG -7 -6} MAL MID NAO 
			NTH NWG PER {RED 3} SAO SKA SOG TYR WBS WHI WME
		}}
		greens {{coordinates provinces} Territories g {DarkGreen DarkGreen A} {
			IRN
		}}
		beaches {{coordinates provinces} Territories b {Yellow {} F} {
			IRN/NC IRN/SC
		}}
	}
	powers {
		Britain {{} {} White}
		Egypt {{} {} White}
		{}
	}
	units {
		army A
		fleet F
		wing {W Wing}
	}
	frame {{bbox 1 1 3} {} LandBrown FrameBorder}
	layout {corner owners} fontSize 7
	orderColumns 2 orderHasHeading 2 retreatHasHeading 3 adjustmentHasHeading 3
	drawLayoutBorder 7 composed 1 printLayout 0 testBorder 0
	addPage 1 pageContents1 {
		"\{"

		"200 40 DrawFleet"
		"200 40 180 140 ArrowPropose"
		"200 40 100 20 ArrowRetreat"
		"200 40 300 60 ArrowMove"
		
		"180 140 DrawArmy"
		"ProposePhase"
		"180 140 160 240 ArrowMove"
		"RetreatPhase"
		"180 140 80 120 ArrowMove"
		"MovePhase"
		"180 140 280 160 ArrowMove"

		"300 90 DrawFleet"
		"300 90 200 40 180 140 ArrowSupport"
		"300 120 DrawArmy"
		"300 120 180 140 ArrowHold"
		"300 150 DrawFleet"
		"300 150 180 140 160 240 ArrowConvoy"

		"\} dup exec -40 200 translate FailedOrder exec OkOrder 40 -200 translate"
				
		"400 200 DrawFleet"
		"400 200 ArrowArrive"
		"400 230 DrawArmy"
		"400 230 ArrowDepart"
		"400 260 DrawFleet"
		"400 260 ArrowRetreatArrive"
		"400 290 DrawArmy"
		"400 290 ArrowRetreatDepart"
		
		"500 200 DrawFleet"
		"500 200 BuildUnit"
		"500 230 DrawArmy"
		"500 230 DestroyUnit"
		"500 260 DrawFleet"
		"500 260 DisbandUnit"
		"500 290 DrawArmy"
		"500 290 RemoveUnit"
		"500 320 DrawFleet"
		"500 320 FindUnit"
		"500 350 DrawArmy"
		"500 350 LoseUnit"
		"500 380 DrawFleet"
		"500 380 QueryUnit"
    }
}
